<!--
 * @Descripttion: 展示二维码
 * @version: 1.0
 * @Author: 自由如风
 * @Date: 2021-05-22 13:31:10
 * @LastEditors: 自由如风
 * @LastEditTime: 2021-05-22 20:24:10
-->

<template>
  <div class="qr-code" v-if="qrcode_show">
    <div class="qr-container">
      <img :src="qrcode" alt="" />
      <h2>
        <img class="avatar" :src="headimgurl" alt="" />
        <p>{{ nickname }}邀请你进入弹幕间</p>
      </h2>
    </div>
  </div>
</template>

<script>
export default {
  computed: {
    qrcode() {
      return this.$store.state.user.qrcode;
    },
    headimgurl() {
      return this.$store.state.user.user.headimgurl;
    },
    nickname() {
      return this.$store.state.user.user.nickname;
    },
    qrcode_show() {
      return this.$store.state.setting.qrcode_show;
    },
  },
};
</script>

<style scoped>
.qr-code {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(85, 85, 85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 6;
}
.qr-code > .qr-container {
  background-color: white;
  border-radius: 1em;
}

.qr-code > .qr-container > h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em 1em;
}
.qr-code > .qr-container > h2 > .avatar {
  height: 1.5em;
  border-radius: 50%;
  margin-right: 1em;
}
</style>